// Diamond inherit

#include <iostream>
#include <cstring>
using namespace std;

class A { // Basic class
public:
	int m_a;
};

class X : public A { // Middle subclass
	public:
		int m_x;
};

class Y : public A { // Middle subclass
	public:
		int m_y;
};

class Z : public X, public Y { // Aggregation subclass
	public:
		int m_z;
		void foo( ) {
//			m_a = 100;	ambigous 	err
			X::m_a = 100;
		}
};

// designer
// ------------------------------------------------------------------
// user

int main( void ) { 
	Z z;
	cout << "sizeof( z )  = "  << sizeof( z ) << endl;

//	z.m_a = 100; 	ambigous	err
	z.X::m_a = 100;

	return 0;
}

